package com.hntest.entity;

public class Page {
    private int currPage=1;//当前页
    private int pageSize=5;//每页大小
    private int totalCounts;//总记录数
    private int totalPages;//总页数

    public int getCurrPage() {
        return currPage;
    }

    public void setCurrPage(int currPage) {
        this.currPage = currPage;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getTotalCounts() {
        return totalCounts;
    }

    public void setTotalCounts(int totalCounts) {
        this.totalCounts = totalCounts;
        //计算总页数
        this.totalPages=this.totalCounts%this.pageSize==0?
                this.totalCounts/this.pageSize:
                this.totalCounts/this.pageSize+1;

        //this.totalPages=(this.totalCounts-1)/this.pageSize+1;
    }

    public int getTotalPages() {
        return totalPages;
    }

    public void setTotalPages(int totalPages) {
        this.totalPages = totalPages;
    }
}
